function getComponentName(componentName){
    const names = componentName.split('-');
    if(names.length>1){
        const newComponentNames = [names[0]];
        for(let i=1;i<names.length;i++){
            const name = names[i];
            newComponentNames.push(name.substr(0,1).toLocaleUpperCase() + name.substring(1));
        }
        const newComponentName = newComponentNames.join('');
        return newComponentName;
    }else{
        let newComponentName = componentName.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();
        if(newComponentName.indexOf('-') === 0){
            newComponentName = newComponentName.substring(1);
        }
        return newComponentName;
    }
}
export {
    getComponentName
}